<?php get_header(); ?>

<div id="content-container">		
	<div class="content">

	<?php if(have_posts()) : ?>
 		<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>

		<?php /* If this is a category archive */ if (is_category()) { ?>				
		<h2 class="pagetitle">Category: <?php echo single_cat_title(); ?></h2>

		<?php if (function_exists('is_tag')) { ?>
			<?php /* If this is a tag archive */ } elseif (is_tag()) { ?>
			<h2 class="pagetitle">Archive for the '<?php single_tag_title(); ?>' tag</h2>
		<?php } ?>
		
		<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
		<h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
		
		<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
		<h2 class="pagetitle">Archive for <?php the_time('F Y'); ?></h2>

		<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
		<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
		
		<?php /* If this is an author archive */ } elseif (is_author()) { ?>
		<h2 class="pagetitle">Author archives</h2>

		<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		<h2 class="pagetitle">Blog Archives</h2>

		<?php } ?>

	<?php while(have_posts()) : the_post(); ?>
	<div class="post">
		<div class="title">
			<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>

			<div class="info">
			<span class="day"><?php the_time('d'); ?></span>
			<span class="month"><?php the_time('M'); ?></span>
			<span class="folder"><?php the_category(', ') ?> </span>
			<span class="comment"><a href="<?php the_permalink() ?>#comments"> <?php comments_number('No comment','1 comment','% comments'); ?></a></span>
			</div>
		</div>

		<div class="entry">
		<?php the_content('&raquo; Read the rest of the entry.. ') ?>
		<?php trackback_rdf(); ?>
		</div>
	</div>
	<?php endwhile; ?>
		<?php else: ?>
		<?php include (TEMPLATEPATH . '/notfound.php'); ?>		

		<?php endif; ?>
		<div class="floatleft"><?php next_posts_link('<span class="prev"> PREVIOUS</span>') ?></div>
		<div class="floatright"><?php previous_posts_link('<span class="next">NEXT <span>') ?></div>
	</div>

<div id="sidebarwrap">
	<div class="intro">
	<?php include (TEMPLATEPATH . '/intro.php'); ?>
	<div class="clear"></div>
	</div>

	<?php include (TEMPLATEPATH . '/searchform.php'); ?>
	<?php include (TEMPLATEPATH . '/sidebar3.php'); ?>
	<?php get_sidebar(); ?>
	<?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
</div>
<div class="clear"></div>
</div>
<?php get_footer(); ?>
